package view;

import com.alee.laf.WebLookAndFeel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;


public class Startfenster extends javax.swing.JFrame {

    private JFrame frameStart;

    public static void main(String[] args) {
        WebLookAndFeel.install();


        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    Startfenster window = new Startfenster();
                    window.frameStart.setVisible(true);
                    window.frameStart.getContentPane().setBackground(new Color(255, 215, 0));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }


    public Startfenster() {
        initialize();
      
        
    }

    private void initialize() {

    
        // Deklarieren des neuen Frames inklusive Schließenoption und Start-Button
        frameStart = new JFrame();
        frameStart.setTitle("Die Jagd nach dem verlorenem Baum");
        frameStart.setResizable(false);
        frameStart.setBounds(0, 0, 800, 600);
        frameStart.setBackground(Color.WHITE);
        frameStart.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
        
        JPanel plStart = new JPanel(new BorderLayout());
        
  

        JButton btnStart = new JButton("Start");
        plStart.add( btnStart, BorderLayout.LINE_END);
       
        
        //Problem -> er findet den Pfad und dieser ist auch korrekt,aber es kommt kein Bild
        Icon icon = new ImageIcon("pics/BaumBegruessung.jpg");
        JLabel jlBild = new JLabel(icon);
        plStart.add(jlBild, BorderLayout.CENTER);
        jlBild.setVisible(true);
        frameStart.getContentPane().add(plStart);
        frameStart.setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        btnStart.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                //Tabellenansicht starten
                Tabellenansicht tabellenAnsicht = new Tabellenansicht();
                frameStart.dispose();
            }
        });
        frameStart.setLocationRelativeTo(null);
        
    }

}
